export default function OrderApi() {
    let _u = uni.$u
    return {
        // 查询订单列表
        queryOrderListPage: function (data: any) {
            return _u.get('/order/order/app/queryOrderListPage', data, {
                useMask: true,
                useJsonParam: true
            })
        },
        // 订单详情
        queryOrderDetail: function (data: any) {
            return _u.get('/order/order/app/queryOrderListInfo', data, {
                useMask: true,
                useJsonParam: true
            })
        },
        // 提交订单
        addOrder: function (params: any) {
            return _u.post('/order/order/addOrder', params, {
                useJsonParam: true,
                useMask: true
            })
        },
        // 取消订单
        cancelOrder: function (params: any) {
            return _u.post('/order/order/app/cancelOrder', params, {
                useJsonParam: true
            })
        },
        //确认收货
        confirmReceipt: function (params: any) {
            return _u.get('/order/order/app/affirmOrder', params, {
                useJsonParam: true
            })
        },
        // 确认支付
        pay: function (params: any) {
            return _u.post('/order/order-pay/pay', params, {
                useJsonParam: true,
                useMask: true
            })
        },
        // 检查订单支付状态
        queryOrderPayStatus(params: any) {
            return _u.post('/order/order-pay/queryOrderPayStatus', params, {
                useMask: true
            })
        },
        // 查询订单物流信息
        queryRoutes: (params: any) => {
            return _u.post('/order/order/queryOrderRoutes', params, {
                useMask: true
            })
        },
        // 查询订单物流信息 快递100
        queryRoutesByExpress100: (params: any) => {
            return _u.post('/order/order/queryRoutesByExpress100', params, {
                useMask: true
            })
        },
        // 查询订单数量
        queryOrderCount: (params: any) => {
            return _u.get('/order/order/myOrderInfo', params, {
                useJsonParam: true
            })
        },
        // 授信还款 支付
        billPay: (params: any) => {
            return _u.post('/order/order-pay/billPay', params, {
                useJsonParam: true
            })
        },
        // 验证订单支付状态
        checkOrderPayStatus: (id: string | number) => {
            return _u.get('/order/order/orderIsPay', id, {
                useJsonParam: true,
                useMask: true
            })
        },
        // 查询可开发票的订单
        queryInvoiceOrderDetail(params: any) {
            return _u.post('/order/order-invoice/queryInvoiceOrderDetail', params, {
                useMask: true
            })
        },
        // 开票记录
        queryOrderInvoiceList(params: any) {
            return _u.post('/order/order-invoice/queryOrderInvoiceListApp', params, {
                useMask: true
            })
        },
        // 发票详情
        queryOrderInvoiceById(params: any) {
            return _u.post('/order/order-invoice/queryOrderInvoiceByIdApp', params, {
                useMask: true
            })
        },
        // 发票详情明细
        queryOrderInvoiceDetailById(params: any) {
            return _u.post('/order/order-invoice/queryOrderInvoiceDetailByIdApp', params, {
                useMask: true
            })
        },
        // 开票
        saveOrderInvoice(params: any) {
            return _u.post('/order/order-invoice/saveOrderInvoice', params, {
                useMask: true,
                useJsonParam: true
            })
        },
        // 收货清单
        queryDeliverList(params: any) {
            return _u.post('/order/order-deliver/queryDeliverList', params, {
                useMask: true
            })
        },
        // 退款售后（退款中，申请记录）查询
        queryOrderRefundLog(params: any) {
            return _u.post('/order/orderRefund/queryOrderRefundLog', params, {
                useMask: true
            })
        },
        // 退货信息
        addOrderRefundWarehouse(params: any) {
            return _u.post('/wms/wms-refund/updateWmsRefund', params, {
                useMask: true,
                useJsonParam: true
            })
        },
        // 发起退款
        saveOrderRefund(params: any) {
            return _u.post('/order/orderRefund/saveOrderRefund', params, {
                useMask: true,
                useJsonParam: true
            })
        },
        // 取消退款
        cancelOrderRefund(params: any) {
            return _u.post('/order/orderRefund/cancelOrderRefund', params, {
                useMask: true
            })
        },
        // 退货退款详情
        queryOrderRefundInfoApp(params: any) {
            return _u.post('/order/orderRefund/queryOrderRefundInfoApp', params, {
                useMask: true
            })
        },
        // 发货单确认收货
        confirmDeliver(params: any) {
            return _u.post('/order/order-deliver/confirmDeliver', params, {
                useMask: true
            })
        },
        // 退款申请记录
        queryOrderRefundLogListApp(params: any) {
            return _u.post('/order/orderRefundLog/queryOrderRefundLogListApp', params, {
                useMask: true
            })
        },
        // 查询商品改价记录
        queryGoodsOrderAlterPrice(params: any) {
            return _u.post('/order/order-alter-price/queryGoodsOrderAlterPrice', params)
        },
        // 查询退回限制条件
        reGoodsLimit(params: any) {
            return _u.get('/order/refund-strategy/reGoodsLimit', params)
        },
        /**
         * 创建 合并支付单
         * @param {Object} params {orderIds: 订单号数组}
         */
        createMergePay(params: any) {
            return _u.post('/order/batch-pay/createBatchPay', params, {
                useJsonParam: true
            })
        },
        /**
         * 查询 合并付款单信息
         * @param {Object} params { code : 支付单单号 }
         */
        queryMergeOrderInfo(params: any){
            return _u.get('/order/batch-pay/appOrderInfo', params)
        },
        /**
         * 撤销 合并
         * @param {Object} params
         */
        revocationMergeOrder(params: any){
            return _u.post('/order/batch-pay/cancelByCode', params)
        },
        /**
         * 合并订单 发起支付
         * @param {Object} params
         */
        mergePay(params: any){
            return _u.post('/order/batch-pay/pay', params, {
                useJsonParam: true
            })
        }
    }
}
